package ShareYourWay.project;

// Generated 04-dic-2013 10:29:32 by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Meetup generated by hbm2java
 */
@Entity
@Table(name = "meetup", catalog = "shareyourway")
public class Meetup implements java.io.Serializable {

	private Integer idMeetup;
	private User user;
	private String vehicle;
	private String origin;
	private String destination;
	private String timeMeet;
	private Integer slots;
	private String ocity;
	private String dcity;
	private String mdate;
	
	private Set<Usermeetup> usermeetups = new HashSet<Usermeetup>(0);

	public Meetup() {
	}
	public Meetup(Meetup m)
	{	//this.idMeetup = m.idMeetup;
		this.user = m.user;
		this.vehicle = m.vehicle;
		this.origin  = m.origin;
		this.destination = m.destination;
		this.timeMeet = m.timeMeet;
		this.slots = m.slots;
		this.ocity=m.ocity;
		this.dcity=m.dcity;
		this.mdate = m.mdate;
	}
	
	
	
	
	
	public Meetup(Integer idMeetup, User user, String vehicle, String origin,
			String destination, String timeMeet, Integer slots, String ocity,
			String dcity, String mdate) {
		super();
		this.idMeetup = idMeetup;
		this.user = user;
		this.vehicle = vehicle;
		this.origin = origin;
		this.destination = destination;
		this.timeMeet = timeMeet;
		this.slots = slots;
		this.ocity = ocity;
		this.dcity = dcity;
		this.mdate = mdate;
	}
	public Meetup(User user, String vehicle, String origin, String destination,
			String timeMeet) {
		this.user = user;
		this.vehicle = vehicle;
		this.origin = origin;
		this.destination = destination;
		this.timeMeet = timeMeet;
	}

	public Meetup(User user, String vehicle, String origin, String destination,
			String timeMeet, Integer slots, Set<Usermeetup> usermeetups) {
		this.user = user;
		this.vehicle = vehicle;
		this.origin = origin;
		this.destination = destination;
		this.timeMeet = timeMeet;
		this.slots = slots;
		this.usermeetups = usermeetups;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id_meetup", unique = true, nullable = false)
	public Integer getIdMeetup() {
		return this.idMeetup;
	}

	public void setIdMeetup(Integer idMeetup) {
		this.idMeetup = idMeetup;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_creator", nullable = false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "vehicle", nullable = false, length = 20)
	public String getVehicle() {
		return this.vehicle;
	}

	public void setVehicle(String vehicle) {
		this.vehicle = vehicle;
	}

	@Column(name = "origin", nullable = false, length = 250)
	public String getOrigin() {
		return this.origin;
	}

	public void setOrigin(String origin) {
		this.origin = origin;
	}

	@Column(name = "destination", nullable = false, length = 250)
	public String getDestination() {
		return this.destination;
	}

	public void setDestination(String destination) {
		this.destination = destination;
	}

	@Column(name = "time_meet", nullable = false, length = 15)
	public String getTimeMeet() {
		return this.timeMeet;
	}

	public void setTimeMeet(String timeMeet) {
		this.timeMeet = timeMeet;
	}

	@Column(name = "slots")
	public Integer getSlots() {
		return this.slots;
	}

	public void setSlots(Integer slots) {
		this.slots = slots;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "meetup")
	public Set<Usermeetup> getUsermeetups() {
		return this.usermeetups;
	}

	public void setUsermeetups(Set<Usermeetup> usermeetups) {
		this.usermeetups = usermeetups;
	}
	
	@Column(name = "ocity", nullable = true, length = 250)
	public String getOcity() {
		return ocity;
	}
	public void setOcity(String ocity) {
		this.ocity = ocity;
	}
	@Column(name = "dcity", nullable = true, length = 250)
	public String getDcity() {
		return dcity;
	}
	public void setDcity(String dcity) {
		this.dcity = dcity;
	}
	@Column(name = "mdate", nullable = false, length = 250)
	public String getMdate() {
		return mdate;
	}
	public void setMdate(String mdate) {
		this.mdate = mdate;
	}
	
	

}
